<!doctype html>
<html lang='en' >
  <head>
    <title>TitleCaps</title>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
  </head>

  <body ng-app='HomeModule' ng-controller="HomeController">
   <h1>{{pageHeading | titleCase}}</h1>

  <script>
    function HomeController($scope) {
      $scope.pageHeading = 'behold the majesty of your page title';
    }

    var homeModule = angular.module('HomeModule', []);
    homeModule.filter('titleCase', function() {
      var titleCaseFilter = function(input) {
        var words = input.split(' ');
        for (var i = 0; i < words.length; i++) {
          words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);
        }
        return words.join(' ');
      };
      return titleCaseFilter;
    });
  </script>
  </body>
</html>
